<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html>
<head>
    <jsp:include page="/static/common/common.jsp"/>
    <!--employee js代码-->
    <script src="/static/js/employee.js"></script>
    <title>员工管理</title>
</head>
<body>
<%--数据表格--%>
<table id="emp_datagrid">
</table>

<%--emp_toolbar工具框--%>
<div id="emp_toolbar">
    <shiro:hasPermission name="employee:saveOrUpdate">
        <a class="easyui-linkbutton" iconCls="icon-add" plain="true"
           data-cmd="add">新增</a>
        <a class="easyui-linkbutton" iconCls="icon-edit" plain="true"
           data-cmd="edit">编辑</a>
    </shiro:hasPermission>
    <shiro:hasPermission name="employee:resetPassword">
        <a id="state_btn" class="easyui-linkbutton" iconCls="icon-remove"
           plain="true"
           data-cmd="changeState">离职</a>
    </shiro:hasPermission>
    <a class="easyui-linkbutton" iconCls="icon-reset" plain="true"
       data-cmd="resetPassword">重置密码</a>

    <a class="easyui-linkbutton" iconCls="icon-clear" plain="true"
       data-cmd="importXls">导入</a>

    <a class="easyui-linkbutton" iconCls="icon-clear" plain="true"
       data-cmd="exportXls">导出</a>
    <%--模糊查询--%>
    <input id="keyword" class="easyui-textbox" prompt="请输入用户名或电话">

    <%--根据时间查询--%>
    <input class="easyui-datebox" id="beginDate"/> -
    <input class="easyui-datebox" id="endDate"/>

    <%--根据部门查询--%>
    <input id="deptId" class="easyui-combobox" data-options="panelHeight:'auto', url:'/department/list.do',
                               valueField:'id',textField:'name'" prompt="请输入部门名称">

    <a class="easyui-linkbutton" iconCls="icon-search" plain="true"
       data-cmd="query">查询</a>
</div>

<%--上传文件弹出框--%>
<div id="import_dialog">
    <form id="import_form" method="post" enctype="multipart/form-data">
        <table align="center" style="margin-top: 15px">
            <tbody>
                <tr>
                    <td>
                        <input type="file" name="file">
                    </td>
                </tr>
            <tr>
                <td>
                    <input id="import_btn" type="button" value="上传">
                </td>
            </tr>
            </tbody>
        </table>
    </form>
</div>

<%--员工编辑弹出框--%>
<div id="emp_dialog" align="center">
    <form id="emp_form" method="post">
        <input type="hidden" name="id" id="empId">
        <table align="center" style="margin-top: 15px">
            <tbody>
            <tr>
                <td>用户名:</td>
                <td><input name="username" class="easyui-textbox"
                           prompt="请输入用户名"
                           invalidMessage="用户名已存在"
                           validType="remote['/employee/validateName.do?id='+empId.value,'username']">
                </td>
            </tr>
            <tr>
                <td>真实姓名:</td>
                <td><input name="realname" class="easyui-textbox"
                           prompt="请输入真实姓名"></td>
            </tr>
            <tr id="pwd">
                <td>密码:</td>
                <td><input name="password" class="easyui-passwordbox"
                           prompt="请输入密码"></td>
            </tr>
            <tr>
                <td>邮箱:</td>
                <td><input name="email" class="easyui-textbox"
                           data-options="validType:['email','length[0,20]']"
                           prompt="请输入邮箱"></td>
            </tr>
            <tr>
                <td>电话:</td>
                <td><input name="tel" class="easyui-numberbox" prompt="请输入电话">
                </td>
            </tr>
            <tr>
                <td>入职时间:</td>
                <td><input name="hireDate" class="easyui-datebox"></td>
            </tr>
            <tr>
                <td>部门名称:</td>
                <td><input name="dept.id" class="easyui-combobox"
                           data-options="panelHeight:'auto', url:'/department/list.do',
                               valueField:'id',textField:'name'"></td>
            </tr>
            <tr>
                <td>管理员:</td>
                <td><input name="admin" class="easyui-combobox"
                           data-options="panelHeight:'auto', valueField:'value',textField:'text',
                        data:[{text:'是',value:'1'},{text:'否',value:'0'}]"></td>
            </tr>
            <tr>
                <td>角色:</td>
                <td><input id="role_combobox" class="easyui-combobox"
                           data-options="multiple:true, panelHeight:'auto', valueField:'id',textField:'name',
                           url:'/role/list.do'"></td>
            </tr>
            </tbody>
        </table>
    </form>
</div>
</body>
</html>
